package com.corpgovernment.organization.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class OrgWebMvcConfigurer implements WebMvcConfigurer {
    @Autowired
    private IpCheckInterceptor ipCheckInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(ipCheckInterceptor).addPathPatterns("/**");
    }

    /*@ApolloConfig
    private Config config;

    @Autowired
    private OrganizationController orgSrv;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        ApiReqHandler.addDefaultInterceptor(registry, config, orgId -> orgSrv.findOrgInfoByOrgId(orgId).getData() != null, Arrays.asList("/employee/existence"));
    }*/

}